<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>IsInsideStroke</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">IsInsideStroke()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#3A3966"><b>IsInsideStroke</b></font>(x.d, y.d, Width.d [, Flags [, CoordinateSystem]])</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Tests if the given coordinates are within an area that will be drawn to by a call 
to <a href="strokepath.html">StrokePath()</a>. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>x.d, y.d</i></td>
<td width="90%"> 
 
Specifies the coordinates of the point to test. 

 

</td></tr>
<tr><td><i>Width.d</i></td>
<td> 
 
Specifies the line width to use for the test. 

 

</td></tr>
<tr><td><i>Flags (可选)</i></td>
<td> 
 
Possible flags for the line characteristics as described in the <a href="strokepath.html">StrokePath()</a> function. 

 

</td></tr>
<tr><td><i>CoordinateSystem (optional)</i></td>
<td> 
 
Specifies the coordinate system for the point to test. This can be one of the following values: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Coordinate_Device</font>: The coordinate system of the output device
  <font color="#924B72">#PB_Coordinate_Output</font>: The coordinate system as it was created with the drawing output function
  <font color="#924B72">#PB_Coordinate_User</font>  : The coordinate system for points in the drawing path (default)
  <font color="#924B72">#PB_Coordinate_Source</font>: The coordinate system for the vector drawing source
</font></pre>

</td></tr>
</table>
</blockquote><p><b>备注</b></p><blockquote>



See the <a href="index.html">vectordrawing overview</a> for an introduction to the different 
coordinate systems. 

 

</blockquote><p><b>返回值</b></p><blockquote>



Returns non-zero if the point is within the stroke and zero if not. 

 

</blockquote><p><b>示例</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; This example uses the IsInsideStroke() function to color the figure in green</font>
  <font color="#3A3966">; while the mouse on its outline and blue otherwise</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">Procedure</font></b> <font color="#3A3966">Draw</font>()
    x =<font color="#3A3966"> GetGadgetAttribute</font>(0, <font color="#924B72">#PB_Canvas_MouseX</font>)
    y =<font color="#3A3966"> GetGadgetAttribute</font>(0, <font color="#924B72">#PB_Canvas_MouseY</font>)
  
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">StartVectorDrawing</font>(<font color="#3A3966">CanvasVectorOutput</font>(0))
<font color="#3A3966">      VectorSourceColor</font>(<font color="#3A3966">RGBA</font>(255, 255, 255, 255))         <font color="#3A3966">; erase previous content</font>
<font color="#3A3966">      FillVectorOutput</font>()
      
<font color="#3A3966">      AddPathEllipse</font>(200, 100, 150, 75)                   <font color="#3A3966">; prepare path</font>
      
      <b><font color="#3A3966">If</font></b> <font color="#3A3966">IsInsideStroke</font>(x, y, 20, <font color="#924B72">#PB_Path_Default</font>, <font color="#924B72">#PB_Coordinate_Device</font>)  <font color="#3A3966">; check if the mouse is inside</font>
<font color="#3A3966">        VectorSourceColor</font>(<font color="#3A3966">RGBA</font>(0, 255, 0, 255))
      <b><font color="#3A3966">Else</font></b>
<font color="#3A3966">        VectorSourceColor</font>(<font color="#3A3966">RGBA</font>(0, 0, 255, 255))
      <b><font color="#3A3966">EndIf</font></b>
      
<font color="#3A3966">      StrokePath</font>(20)                                      <font color="#3A3966">; stroke path</font>
<font color="#3A3966">      StopVectorDrawing</font>()
    <b><font color="#3A3966">EndIf</font></b>
  <b><font color="#3A3966">EndProcedure</font></b>
  
  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 400, 200, "VectorDrawing", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">    CanvasGadget</font>(0, 0, 0, 400, 200)
<font color="#3A3966">    LoadFont</font>(0, "Times New Roman", 20, <font color="#924B72">#PB_Font_Bold</font>)
<font color="#3A3966">    Draw</font>()
    
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()
      
      <b><font color="#3A3966">If</font></b> Event = <font color="#924B72">#PB_Event_Gadget</font> <b><font color="#3A3966">And</font></b> <font color="#3A3966">EventGadget</font>() = 0 <b><font color="#3A3966">And</font></b> <font color="#3A3966">EventType</font>() = <font color="#924B72">#PB_EventType_MouseMove</font>
<font color="#3A3966">        Draw</font>()
      <b><font color="#3A3966">EndIf</font></b>
      
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="isinsidepath.html">IsInsidePath()</a>, <a href="strokepath.html">StrokePath()</a>, <a href="resetpath.html">ResetPath()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=isinsidepath.html>IsInsidePath()</a> - <a href="index.html">VectorDrawing Index</a> - <a href="ispathempty.html">IsPathEmpty()</a> -&gt;<br><br>

</body></html>